//
//  HealthTools.h
//  分享demo
//
//  Created by pc-chtypd056 on 2018/8/13.
//  Copyright © 2018年 CTL. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <HealthKit/HealthKit.h>

@interface HealthTools : NSObject

@property (nonatomic, strong) HKHealthStore *healthStore;

+ (instancetype)sharedInstance;

/*
 *  @brief  检查是否支持获取健康数据
 */
- (void)authorizeHealthKit:(void(^)(BOOL success, NSError *error))complete;

/*!
 *  @brief  写权限
 *  @return 集合
 */
- (NSSet *)dataTypeWrite;

/*!
 *  @brief  读权限
 *  @return 集合
 */
- (NSSet *)dataTypeTRead;

/*!
 *  @brief  获取步数
 */
- (void)getHealthStepCount:(void(^)(double value, NSError *error))complete;

 /*!
 *  @brief  获取公里数
 */
- (void)getHealthDistance:(void(^)(double value, NSError *error))complete;
/*!
 *  @brief  当天时间段
 *
 *  @return 时间段
 */
+ (NSPredicate *)predicateForSamplesToday;

@end
